Birthday Cake Candles using c++ 您所在的位置:网站首页 birthday cake with candles Birthday Cake Candles using c++

Birthday Cake Candles using c++

2023-09-11 18:19| 来源: 网络整理| 查看: 265

You are in charge of the cake for your niece's birthday and have decided the cake will have one candle for each year of her total age. When she blows out the candles, she’ll only be able to blow out the tallest ones. Your task is to find out how many candles she can successfully blow out.

For example, if your niece is turning 4 years old , and the cake will have 4 candles of height 4,4,1,3 , she will be able to blow out 2 candles successfully, since the tallest candles are of height 4 and there 2 such candles.

Function Description

Complete the function birthdayCakeCandles in the editor below. It must return an integer representing the number of candles she can blow out. birthdayCakeCandles has the following parameter(s):

An array of integers representing candle heights

Input Format

The first line contains a single integer,n denoting the number of candles on the cake. The second line contains n space-separated integers, where each integer i describes the height of candle i.

Constraints

-1



【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有